package com.jz.beijianbao.legalPersonPlant.mapper;

import com.jz.beijianbao.legalPersonPlant.bean.LegalPersonXiala;
import com.jz.beijianbao.legalPersonPlant.bean.LegalPlant;
import com.jz.beijianbao.legalPersonPlant.bean.PlantSelectVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LegalPlantMapper {


    List<LegalPersonXiala> queryPerson(Integer id);

    List<LegalPlant> queryPage(PlantSelectVo plantSelectVo);

    int queryCount(PlantSelectVo plantSelectVo);
    @Select("select * from legalPlant where legalPlantCode=#{legalPlantCode}")
    LegalPlant queryByCode(String legalPlantCode);

    @Insert("insert into legalPlant (legalPersonCode,legalPlantCode,legalPlantDec,enabled,createTime,createName)" +
            "values (#{legalPersonCode},#{legalPlantCode},#{legalPlantDec},#{enabled},#{createTime},#{createName})")
    void addPlant(LegalPlant legalPlant1);

    @Select("select * from legalPlant where id = #{id}")
    LegalPlant queryById(Integer id);

    @Update("update legalPlant set legalPlantDec = #{legalPlantDec},enabled = #{enabled},updateName = #{updateName},updateTime = #{updateTime} where id = #{id}")
    void updatePlant(LegalPlant legalPlant1);

    @Select("select * from legalPlant where id = #{id}")
    LegalPlant queryEnabledById(Integer id);

    @Update("update legalPlant set enabled = #{enabled},updateName = #{updateName},updateTime = #{updateTime} where id = #{id}")
    void updateStatus(LegalPlant legalPlantVo);
}
